#coding=utf-8
import _prepare

from tornado.ioloop import IOLoop
from tornado.gen import coroutine
from tornado.httpclient import AsyncHTTPClient
from services.search_engine.request_gen import SearchInterface
if __name__=='__main__':
    @coroutine
    def search_test():
        client = AsyncHTTPClient()
        request = SearchInterface().must_have(category_name='创投咨询').might_have(source_name='媒体').order_by('timestamp',desc=True).gen_request()
        responce = yield client.fetch(request)
        print responce.body

    IOLoop.current().run_sync(search_test)